package com.xiyang.boot.controller;

import com.xiyang.boot.JavafxSpringboot4Application;
import com.xiyang.boot.view.LoginView;
import com.xiyang.boot.view.MainView;
import de.felixroske.jfxsupport.FXMLController;
import de.felixroske.jfxsupport.GUIState;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import org.springframework.beans.factory.annotation.Autowired;

import java.net.URL;
import java.util.ResourceBundle;

/**
 * @author xiyang.ycj
 * @since Dec 03, 2019 14:06:42 PM
 */
@FXMLController
public class LoginController implements Initializable {

    public Button button;
    public VBox vbox;

    @Autowired
    private MainView mainView;

    @Override
    public void initialize(URL location, ResourceBundle resources) {
        button.setOnAction(event -> {
//            vbox.getChildren().addAll(mainView.getView());
//            GUIState.getStage().setWidth(600);
//            // 将舞台置于窗口中央
//            GUIState.getStage().centerOnScreen();
            JavafxSpringboot4Application.showView(MainView.class);

        });
    }
}
